import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Day1 from '@/views/exercise/Day1.vue'
import PictureInPicture from '@/views/exercise/PictureInPicture.vue'
import Virtuallist from '@/views/exercise/bigData/Virtuallist.vue'
import VirtualScroller from '@/views/exercise/bigData/VirtualScroller.vue'
import PromiseA from '@/views/newJob/PromiseA/PromiseA.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue'),
    },
    {
      path: '/oneMap',
      name: 'oneMap',
      component: () => import('../views/OneMap.vue'),
    },
    {
      path: '/viewerTest',
      name: 'viewerTest',
      component: () => import('../views/viewerTest.vue'),
    },
    {
      path: '/exercise',
      name: 'exercise',
      children: [
        {
          path: '/exercise/day1',
          name: 'day1',
          component: Day1,
        },
        {
          path: '/exercise/pip',
          name: 'pip',
          component: PictureInPicture,
        },
        {
          path: '/exercise/bigData',
          name: 'bigData',
          children: [
            {
              path: '/exercise/bigData/virtuallist',
              name: 'virtuallist',
              component: Virtuallist,
            },
            {
              path: '/exercise/bigData/virtualScroller',
              name: 'virtualScroller',
              component: VirtualScroller,
            },
          ],
        },

      ]
    },
    {
      path: '/newJop',
      name: 'newJop',
      children: [
        {
          path: '/newJop/promiseA',
          name: 'promiseA',
          component: PromiseA,
        },
      ]
    },
  ],
})

export default router
